/**
 * WhileTimes.java
 * Code the WhileTimes.java program from page A-31. Compile and run the program.
 * Convert the program from a while loop to a for loop. That is, rewrite the 
 * program using a for loop instead of the while loop. Compile and run the 
 * program and then post your completed for-loop program to the Forum labeled 
 * Seminar One Answer Forum. (50 points)
 *
 * @author: John Thomason
 *    Date: Nov 8, 2008 / 7:28:10 AM
 *   Class: CS222 Java II
 */


/**
 * WhileTimes Class
 */
public class WhileTimes {

  /**
   * Application Entry Point
   * @param args The command line arguments
   */
  public static void main(String[] args) {
   
    ObjectFour four = new ObjectFour();
    four.go();
   
  }//end main()

}//end WhileTimes class

/**
 * ObjectFour Class
 */
class ObjectFour {
  
  public void go(){
    
    /**
     * Original nested while loops
    int x,y;
    
    y = 1;
    while( y <= 10 ){
      
      x = 1;
      while( x <= 10 ){
        
        System.out.print( " " + (x * y));
        x = x + 1;
        
      }//inner while()
      
      System.out.println();
      y = y + 1;
      
    }//outer while()
     */
    
    /**
     * Recoded nested for loops
     */
    for( int y = 1; y <= 10; y++ ){
      
      for( int x = 1; x <= 10; x++ ){
        
        System.out.printf("%4d", (x * y));
        
      }//inner for()
      
      System.out.println();
      
    }//outer for()
    
  }//end go()
  
}//end ObjectFour